package com.controller.generic_controller;

import com.service.iter.generic_service.IMenuService;
import com.util.Res;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 菜单控制器
 *
 * @author admin
 * @date 2023/06/19
 */
@RestController
@RequestMapping("menu")
public class MenuController {
    /**
     * 菜单服务
     */
    @Autowired
    private IMenuService menuService;

    /**
     * 得到菜单
     *
     * @param role 角色
     * @return {@link Res}
     */
    @GetMapping("{role}")
    public Res getMenus(@PathVariable Long role) {
        return menuService.getMenus(role);
    }
}
